<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>评审列表</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,LightYearAdmin,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="Light Year Admin V4是一个后台管理系统的HTML模板，基于Bootstrap v4.4.1。">
    <meta name="author" content="yinqi">
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="/static/js/jquery-confirm/jquery-confirm.min.css" rel="stylesheet">
    <link href="/static/css/animate.min.css" rel="stylesheet">
    <link href="/static/css/style.min.css" rel="stylesheet">
    <style>
        .avatar{
            width: 30px;
            height: 30px;
        }
    </style>
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>评审职务</th>
                                <th>科研成果</th>
                                <th>进度</th>
                                <th>总分</th>
                                <th>状态</th>
                                <th>发起时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach $assessments as $assessment}
                            <tr>
                                <td>
                                    {$assessment['id']}
                                </td>
                                <td>{$assessment['level']}</td>
                                    <!--查看描述模态框-->
                                    <div class="modal fade" id="{$assessment.id}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabelDec" aria-hidden="true">
                                        <div class="modal-dialog" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h6 class="modal-title" id="exampleModalLabelDec">申请描述</h6>
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                        <span aria-hidden="true">&times;</span>
                                                    </button>
                                                </div>
                                                <div class="modal-body">
                                                    <textarea class="form-control" disabled style="height: 300px">
                                                         {$assessment['describe']}
                                                    </textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                     <!-- 打分模态框-->
                                    <div class="modal fade" id="{$assessment.id}editScore" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
                                        <div class="modal-dialog" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h6 class="modal-title" id="exampleModalLabel">打分</h6>
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                        <span aria-hidden="true">&times;</span>
                                                    </button>
                                                </div>
                                                <div class="modal-body">
                                                    <form action="{:url('editScore')}" method="post" class="row">
                                                        <div class="form-group col-md-12">
                                                            <input type="text"  class="form-control" name="id" value="{$assessment['id']}"  />
                                                        </div>
                                                        <div class="form-group col-md-12">
                                                            <input type="number"  class="form-control" id="score" name="score" value="" placeholder="请输入分数" />
                                                        </div>
                                                        <div class="form-group col-md-12 m-t-10">
                                                            <button type="submit" class="btn btn-primary btn-block  ajax-post" target-form="add-form">提交</button>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <td>
                                    {foreach $assessment['fileList'] as $activite}
                                     <a class="btn btn-xs btn-info" href="{$activite['path']}" target="_blank">{$activite['title']}</a>
                                    {/foreach}
                                </td>
                                <td width="200">
                                    <div class="progress" style="height: 25px;">
                                        <div class="progress-bar progress-bar-striped" role="progressbar" style="width: {$assessment['process']}%" aria-valuenow="{$assessment['process']}" aria-valuemin="0" aria-valuemax="100">{$assessment['process']}%</div>
                                    </div>
                                </td>
                                <td>
                                    {$assessment['scores']}
                                </td>
                                <td>
                                    {if $assessment['state']==0}
                                    <button class="btn btn-xs btn-danger">未完成</button>
                                    {else /}
                                    <button class="btn btn-xs btn-success">已完成</button>
                                    {/if}
                                </td>
                                <td> {:date("Y-m-d h:i:s",$assessment['create_time'])}</td>
                                <td>
                                    <div class="btn-group btn-group-sm">
                                        <button class="btn btn-default"  data-toggle="modal" data-target="#{$assessment.id}">查看申请描述</button>
                                    </div>
                                    <div class="btn-group btn-group-sm">
                                        <button class="btn btn-info" data-toggle="modal" data-target="#{$assessment.id}editScore">打分</button>
                                    </div>
                                    <div class="btn-group btn-group-sm">
                                        <button class="btn btn-danger">删除申请</button>
                                    </div>
                                </td>
                            </tr>
                            {/foreach}
                            </tbody>
                        </table>
                        {if  count($assessments)==0}
                        <p>暂无公告</p>
                        {/if}
                    </div>
                    {$assessments|raw}

                </div>
            </div>
        </div>
    </div>

</div>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/popper.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/lyear-loading.js"></script>
<script type="text/javascript" src="/static/js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="/static/js/main.min.js"></script>
<script type="text/javascript" src="/static/js/msg.js"></script>
<script type="text/javascript">
    function delNotice(id){
        $.confirm({
            title: '',
            content:'确认要执行该操作吗？',
            type: 'orange',
            typeAnimated: true,
            buttons: {
                confirm: {
                    text: '确认',
                    btnClass: 'btn-blue',
                    action: function() {
                        action(id);
                    }
                },
                cancel: {
                    text: '取消',
                    action: function() {}
                }
            }
        });
    }
    function action(id){
        $.ajax({
            url: '/index/notice/delNotice',
            data:{id},
            method:"POST",
            dataType:"json",
            success:function (res){
                if(res.code){
                    msgShow.success(res.msg);
                    setTimeout(()=>{
                        location.reload();
                    },1000)
                }else{
                    msgShow.error(res.msg)
                }
            }
        })
    }

</script>
</body>
</html>